FROM docker.irenshi.cn/lina/oracle-java
MAINTAINER David Wei <david.wei@ihr360.com>

## Change the timezone for 16.04
RUN apt-get install -y tzdata
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /opt
VOLUME /opt
ADD ./target/ihr360-*-provider-*.jar ihr360-oneclick-provider.jar
ENV JAVA_OPTS="-Xmx1g -Xms256m  -XX:NewSize=96m -XX:MaxNewSize=192m -XX:+HeapDumpOnOutOfMemoryError"
EXPOSE 8090
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /opt/ihr360-oneclick-provider.jar" ]